#pragma once
#include "Object.h"
#include <Windows.h>

class CTask:public CObject
{
public:
	void Start();

	void Stop();
	
	bool IsRunning(){return m_bWorking;}

private:
	virtual void Run()		= 0;
	virtual void OnStart()  = 0;
	virtual void OnStop()   = 0;
private:
	volatile bool m_bWorking;

	friend static DWORD WINAPI ThreadFunc(LPVOID lpParam);
};